#黑板客爬虫闯关的第二关
#原网址:http://www.heibanke.com/lesson/crawler_ex01/
#逻辑：密码是30以内的数字，打开网址设置昵称内容，设置密码内容，提交  重复这个过程


#request实现

import requests

url = "http://www.heibanke.com/lesson/crawler_ex02/"

playload = {'username': 'wodetian','password': '1'}

for i in range(30):
    playload['password'] = i
    print(u'传入参数为:'+str(playload))

    r = requests.post(url,data = playload)

    if u"成功" in r.text:
        print(u"闯关成功")
        break


